package com.rongeadi.app.jinrirong;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.facebook.stetho.Stetho;
import com.rongeadi.app.BuildConfig;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by xuyougen on 2018/4/11.
 */

public class MyApplication extends Application {

    private static final String TAG = "TAG";

    private static Context mApplicationContext;

    static {
        // todo 分享配置
        // 配置第三方分享的appKey
        PlatformConfig.setWeixin("wx4fb69db3e61b5f28", "71737dbbcf980251f365a3f57230ef9b");//ab249c8e3e9fabe60b788ef5d306bd20
        //PlatformConfig.setSinaWeibo("1996373625", "86e6913558c7716676726495311c0f02", "http://sns.whalecloud.com");
        PlatformConfig.setQQZone("101545858", "9a41534bb8d97b47109f153c10fb9e7f");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);
        mApplicationContext = this;
        UMConfigure.init(this, "5c3ed8b2f1f556b808000029", "", UMConfigure.DEVICE_TYPE_PHONE, "");
        UMConfigure.setLogEnabled(true);
//        UMConfigure.init(this, "5c3ed8b2f1f556b808000029", "Umeng", UMConfigure.DEVICE_TYPE_PHONE, "vpq3sg2f05pjvjhqosbd6eergdi19bhb");
        debug();
    }


    private void debug() {

        /*Chrome进行网络调试chrome://inspect/#devices*/
        if (BuildConfig.DEBUG) {
            Stetho.initialize(Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());
        }
    }

    public static Context getContext() {
        return mApplicationContext;
    }
}
